<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>煤炭管理系统</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/lib/layui/css/layui-theme-custom.css">
    <link rel="stylesheet" href="/static/css/member.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <#include "/base/main-header.ftl">

    <#include "/base/main-left.ftl">
    <div class="layui-body">
        <!-- 内容主体区域  -->
        <div class="site-title">
            <fieldset>
                <legend>
                    <a class="site-title-text">黑名单申请</a>
                </legend>
            </fieldset>
        </div>

        <div class="table-box">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label label-width">供应商名称：</label>
                    <div class="layui-input-inline">
                        <label class="myLable">北京聚能能源公司</label>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label label-width">备注：</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" class="layui-textarea area-width"></textarea>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label label-width">附件信息：</label>
                    <div class="layui-input-block">
                        <div class="layui-upload">
                            <button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
                            <button type="button" class="layui-btn" id="test9">开始上传</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <#include "/base/main-footer.ftl">
</div>
<script type="text/html" id="option">
    <a href="/{{d.id}}" class="layui-table-link">查看</a>
</script>

<script src="/static/lib/layui/layui.js"></script>
<script>
    layui.use(['layer', 'form', 'element', 'jquery','table','upload'], function () {
        let layer = layui.layer, form = layui.form, $ = layui.$, table = layui.table,upload = layui.upload;

        upload.render({
            elem: '#test8'
            ,url: '/upload/'
            ,auto: false
            ,accept: 'file'
            //,multiple: true
            ,bindAction: '#test9'
            ,done: function(res){
                console.log(res)
            }
        });


        table.render({
            elem: '#dispSupplier'
            ,url:'/'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'id',title: '序号', sort: true}
                ,{field:'',  title: '供应商名称'}
                ,{field:'',  title: '组织机构代码'}
                ,{field:'',  title: '法人'}
                ,{field:'', title: '联系电话'} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'', title: '注册摘要信息'}
                ,{field:'', title: '操作',templet: '#option', unresize: true}
            ]]
            ,id: 'testReload'
            ,page: true
        })

        var active = {
            reload: function(){
                var demoReload = $('#demoReload');
                //执行重载
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    ,where: {
                        key: {
                            id: demoReload.val()
                        }
                    }
                }, 'data');
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });
</script>
</body>
</html>